package com.huangpeng.designmodel.proxyDutyChain;

/**
 * @Author hp
 * @Title
 * @Package
 * @Date 2021/12/28 16:18
 * @Description 登录拦截器
 * @Version 1.0
 */
public class LogInterceptor implements Interceptor {
    @Override
    public Object intercept(Invocation invocation) throws Exception {
        System.out.println("------插入前置通知代码-------------");
        Object result = invocation.process();
        System.out.println("------插入后置处理代码-------------");
        return result;
    }

    @Override
    public Object plugin(Object target) {
        return HWInvocationHandler.wrap(target,this);
    }
}
